/**
 * 临时步骤编辑
 */
 import { useForm } from "../../framework/common/context/metadata-context";
 import {getQuery} from "../../framework/common/utils"
 import "./approveStepReadonly.css"
import Operations from "./Operations";
import React, { useEffect, useRef, useState } from "react";
import clsx from "clsx";
import { Tooltip , Input, Radio, Space, Checkbox, Spin } from "antd";
import get from "lodash/get";
import message from "../../framework/common/utils/message";
import request from "../../framework/common/utils/request";
import getInitiateFormData from "../../framework/common/utils/getInitiateFormData";
import BranchChoose from "./BranchChoose1";
import {v4 as uuid} from 'uuid'
import { InjectProvider, useInject } from "../../framework/common/context/inject-context";
import TemporaryStep from "./TemporaryStep1";//临时步骤模板
import { deleteTemporaryStep } from "./ApproveStepEdit/utility";
import { useUpdate } from "ahooks";
import SelectAuditors from "../SelectAuditors/SelectAuditors";
import { renderName } from "./stepUtility";/*审批步骤数据清洗*/

//对应原模板 jstemp-approve-steps-auditor
export default function JstempApproveStepsAuditor({
    item,
    ind,
    step_type,
    tplData
}){
    // let item = options.item;
    // let ind = options.ind;
    // let step_type = options.step_type;
    if(item.auditor_name){
        return <div className="auditor_info">
            <div className="auditor_tx">
                <i className="name_bg iconfont icon-renmingbeijingtu" style={{"color": item.__auditorColor__}}></i>{/*__auditorColor__ 是初始化数据清洗内给的头像颜色*/}
                <span className="auditor_tx_name">{renderName(item.auditor_name)}</span>
            </div>
            <div className="auditor_main">
                <div>
                    <span className="auditor_name">
                        {
                            item.auditor_name
                        }
                        {
                            step_type == 1
                            && "（发起）"
                        }
                        {
                            step_type == 2
                            && "（归档）"
                        }
                    </span>
                    {
                        (step_type == 1 && tplData && item.auditor_id != tplData.CurUserGUID)
                        &&
                        <span className="cancel_type">{tplData.CurUserName}代为发起</span>
                    }
                </div>
                {
                    (item.station_name && step_type == 1)
                    && <p className="auditor_dp">{item.station_name}</p>
                }
            </div>
        </div>
    }else{
        return null;
    }
}